graph-cycles
Find all cycles in a graph
A naive implementation of Johnson's algorithm to find all cycles in a graph. Based on petgraph.
Example
The triangle graph has exactly one cycle, namely the full graph itself.
use Cycles;
use Graph;
let g = from_edges;
// find all cycles
let cycles = g.cycles;
assert_eq!;
assert_eq!;
// print each cycle in turn
g.visit_all_cycles;
Caveats
This crate is essentially untested.
References
Donald B. Johnson, Finding all the elementary circuits of a directed graph, SIAM Journal on Computing, 1975.
License: MIT or Apache-2.0